import Router_Methods from "../router";

/*
 * @Descripttion:验证工具方法类
 * @LastEditors: xzh
 * @LastEditTime: 2023-08-08 16:38:52
 */
export default class Validator_Methods extends Router_Methods {
  /**
   * @Author: xzh
   * @Descripttion: 验证手机格式
   * @Param:
   * @param {string} value
   */
  static validator_phone(value: string) {
    const regMobile =
      /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/;
    return regMobile.test(value);
  }
  /**
   * @Author: xzh
   * @Descripttion: 验证邮箱
   * @Param:
   * @param {string} value
   */
  static validator_email(value: string) {
    const regEmail = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
    return regEmail.test(value);
  }
}
